import os

from ultralytics import YOLO


def train(data):
    # Load a model
    model = YOLO('yolov8s.pt')  # load a pretrained model (recommended for training)

    # Train the model
    results = model.train(data=data, workers=1, epochs=300)


if __name__ == '__main__':
    train(os.path.join(os.path.dirname(__file__), "data", "train.yaml"))
